package com.lwc.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class Rabbitconfig {

    @Bean
    public Queue queue(){
return  new Queue("simple-queue");
    }
    @Bean
    public DirectExchange directExchange(){
        return  new DirectExchange("simpleEx");
    }
    @Bean
    public Binding binding(DirectExchange directExchange,Queue queue){
        return BindingBuilder.bind(queue).to(directExchange).with("simple");
    }

    @Bean
    public Queue asyncqueue(){
        return  new Queue("async-queue");
    }
    @Bean
    public DirectExchange asyncdirectExchange(){
        return  new DirectExchange("asynctEx");
    }
    @Bean
    public Binding asyncbinding(DirectExchange asyncdirectExchange,Queue asyncqueue){
        return BindingBuilder.bind(asyncqueue).to(asyncdirectExchange).with("async");
    }
}
